{% extends 'base.html' %}
{% block hellw %}
<div class="col-md-9 ">
<article class="comment">
                            <h1 style="text-align: center">{{ news.title }}</h1>
                            <div class="meta" style="text-align: center">
                                <i class="fa fa-user"></i> {{ news.users }} <i class="fa fa-calendar">
                            </i>{{news.create_time.strftime('%Y-%m-%d %H:%M:%S')}}<i class="fa fa-comments"></i><span class="data"></span>
                            </div>
                            <p style="margin-left: 18%">{{ news.text }}</p>
                    </article>
{% if err_message  %}
    <strong style="color: #b92c28">{{ err_message }}</strong>
{% end %}
 <aside class="comments" id="comments">
                        <hr>
                        <h2><i class="fa fa-comments"></i> </h2>
    {% if comments %}
    {% for comment in comments %}
                        <article class="comment">
                            <header class="clearfix">
                                <div class="meta">
                                    <h3><a href="#">{{ comment.users }}</a></h3>
                                    <span class="date">
                                        {{comment.coment_time.strftime('%Y-%m-%d %H:%M:%S') }}
                                    </span>
                                    <span class="separator">
                                    </span>
                                    <a href="#create-comment" class="reply-link"></a>
                                </div>
                            </header>
                             <div class="body">
                             <p> {{ comment.coment }}</p></div>
                        </article>
    {% end %}
    {% end  %}
     {% if not current_user  %}请先
    <a href="/login"> 登录</a>或者前往
    <a href="/reg"> 注册</a>后登陆才能评论！或者去往
<a href="/index/1">首页</a>
        {% end  %}
      {% if  current_user  %}
      <aside class="create-comment" id="create-comment">
                        <hr>
                        <h2><i class="fa fa-pencil"></i> 评论</h2>
<form method="POST" action="/one/{{ news.id }}">
        {% raw xsrf_form_html() %}
       <p> 评论者：<input type="text" name="user" disabled="disabled" value="{{ current_user }}" class="form-control input-lg">
       </p>
         <input rows="10" name="comment" id="comment-body" placeholder="评论内容" class="form-control input-lg">
        <input type="submit" value="评论" class="btn btn-xlarge btn-clean-one">
</form>
{% end %}
      </aside></aside></div>
{% end %}